package com.hmsg.health.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.hmsg.health.security.SecurityInterceptor;


@Configuration
public class AdapterConfigurer extends WebMvcConfigurerAdapter {
	@Autowired
	SecurityInterceptor securityInterceptor;
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		InterceptorRegistration registration = registry.addInterceptor(securityInterceptor);
		registration.excludePathPatterns("/hmsgmn/error");
		registry.addInterceptor(securityInterceptor).addPathPatterns("/**");
		registry.addInterceptor(securityInterceptor).addPathPatterns("/**");
		super.addInterceptors(registry);
	}
}
